package com.jiepos.mpos.core.exception;

import com.jiepos.mpos.common.constant.ExceptionConstant;

/**
 * @ClassName: MposException
 * @Description: 自定义异常类
 * @author 孙永
 * @date 2017年9月25日 下午3:27:37
 */
public class MposException extends RuntimeException {

	private static final long serialVersionUID = -6545356910869730799L;
	
	/** 异常编码*/
	private String code;
	
	/** 异常信息*/
	private String message;

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	
	public MposException(String code, String message){
		super();
		this.code = code;
		this.message = message;
	}
	
	public MposException(String message){
		super();
		this.message = message;
	}
	
	public MposException(ExceptionConstant exceptionConstant){
		this.code = exceptionConstant.getCode();
		this.message = exceptionConstant.getMessage();
	}
	
	public MposException(ExceptionConstant exceptionConstant, String message){
		this.code = exceptionConstant.getCode();
		this.message = message + exceptionConstant.getMessage();
	}
}
